/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package pe.com.unidades;

import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author romulogalindo
 */
public class Placa extends Unidad{

    String THREAD_ID;
    String SUBTHREAD_ID;
    String co_plaveh;
    Double mo_papveh = 0D;
    Double mo_impveh = 0D;
    List<Papeletas> ls_papeletas = new ArrayList<>();
    List<Multas> ls_multas = new ArrayList<>();

    public Placa() {
    }

    public Placa(String co_plaveh) {
        this.co_plaveh = co_plaveh;
    }

    public String getTHREAD_ID() {
        return THREAD_ID;
    }

    public void setTHREAD_ID(String THREAD_ID) {
        this.THREAD_ID = THREAD_ID;
    }

    public String getSUBTHREAD_ID() {
        return SUBTHREAD_ID;
    }

    public void setSUBTHREAD_ID(String SUBTHREAD_ID) {
        this.SUBTHREAD_ID = SUBTHREAD_ID;
    }
    
    public String getCo_plaveh() {
        return co_plaveh;
    }

    public void setCo_plaveh(String co_plaveh) {
        this.co_plaveh = co_plaveh;
    }

    public Double getMo_papveh() {
        return mo_papveh;
    }

    public void setMo_papveh(Double mo_papveh) {
        this.mo_papveh = mo_papveh;
    }

    public Double getMo_impveh() {
        return mo_impveh;
    }

    public void setMo_impveh(Double mo_impveh) {
        this.mo_impveh = mo_impveh;
    }

    public List<Papeletas> getLs_papeletas() {
        return ls_papeletas;
    }

    public void setLs_papeletas(List<Papeletas> ls_papeletas) {
        this.ls_papeletas = ls_papeletas;
    }

    public void setLs_papeletas2(List<Papeletas> ls_papeletas) {
        if (ls_papeletas != null) {
            if (ls_papeletas.size() > 0) {
                for (Papeletas p : ls_papeletas) {
                    this.ls_papeletas.add(p);
                }
            }
        }
//        this.ls_papeletas = ls_papeletas;
    }

    public void add_papeleta(Papeletas papaleta) {
        this.ls_papeletas.add(papaleta);
    }

    public List<Multas> getLs_multas() {
        return ls_multas;
    }

    public void setLs_multas(List<Multas> ls_multas) {
        this.ls_multas = ls_multas;
    }

    @Override
    public String toString() {
        String ori = "[Placa:" + this.getCo_plaveh() + ",Deuda papeletas:" + this.getMo_papveh() + ", Douda por impuestos:" + this.getMo_impveh() + "]\n";
        if (ls_papeletas.size() > 0) {
            for (int i = 0; i < ls_papeletas.size(); i++) {
                ori = ori + ls_papeletas.get(i).toString() + "\n";
            }
        }
        if (ls_multas.size() > 0) {
            for (int i = 0; i < ls_multas.size(); i++) {
                ori = ori + ls_multas.get(i).toString() + "\n";
            }
        }
        return ori;
    }

}
